Conversation
…ffer size
- Replace list-based underline creation with String('-', n) constructor
to eliminate unnecessary list/array allocations in appendSection
- Increase stream copy buffer from 1024 to 81920 bytes (matching .NET
default for Stream.CopyToAsync) to improve download throughput
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Member
|
/repo-assist Please comment the 80KB change with a one-liner |
Contributor
Author
|
Commit pushed:
|
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Two small but meaningful performance improvements to
Helper.fs:appendSection– eliminate unnecessary list/array allocationsThe previous implementation built an underline separator by allocating a list of integers, mapping to
'-'chars, converting to an array, and then calling theStringconstructor. This allocates three short-lived heap objects (int list,char list,char[]) on every print call.Replaced with
String('-', s.Length + 1)which directly constructs the string in a single allocation.copyToCallbackAsync– increase stream copy buffer from 1KB → 80KBThe 1024-byte read/write buffer in
copyToCallbackAsyncmeans roughly 80× more system calls per MB of data transferred compared to the .NET standard default of 81920 bytes (used byStream.CopyToAsync). This directly limits download throughput for large responses.Increased to 81920 bytes (80KB) to match the .NET platform default and reduce round-trips.
Test Status
✅ Build passes:
dotnet buildcompleted with 0 errors (4 pre-existing warnings unrelated to these changes).No new tests were required — these changes preserve existing behaviour exactly; only buffer sizing and allocation strategy differ.